package com.dream.dto;

import com.dream.domain.user.ContactInfo;
import com.dream.domain.user.Token;
import com.dream.domain.user.User;

/**
 * Created by IntelliJ IDEA.
 * User: ZhongGang
 * Date: 12-12-22
 * Time: 下午8:37
 */
public class UserDTO {
    private String username;
    private String password;
    private String reconfirmPassword;
    private String displayName;
    private String email;
    private String phone;
    private String address;
    private String qq;
    private String birthday;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getReconfirmPassword() {
        return reconfirmPassword;
    }

    public void setReconfirmPassword(String reconfirmPassword) {
        this.reconfirmPassword = reconfirmPassword;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public User toUser() {
        Token token = new Token(this.username, this.password);
        ContactInfo contactInfo = new ContactInfo(this.displayName, this.address, this.phone, this.email, this.qq);
        return new User(token, contactInfo);
    }
}
